from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker


DATABASE_URL = "oracle+oracledb://system:oracle@16.176.211.133:1521/?service_name=ORCLPDB1"
engine = create_engine(DATABASE_URL, echo=True)
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)


engine = create_engine(
    DATABASE_URL,
    echo=True,
    future=True,
)
SessionLocal = sessionmaker(
    autocommit=False,
    autoflush=False,
    bind=engine,
    future=True,
)

def get_db():
    db = SessionLocal()
    try:
        yield db
    finally:
        db.close()